List kota
List Provinsi
Service ini digunakan untuk melihat list kode id dari kota
Service Info
HTTP Method | GET |
---|---|
Service Code | 31 |
Http Method | GET |
Path | .../v1.0/list/kota |
Authentication | OAuth 2.0 |
Header
Header Name | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
Content-Type | String | Y | application/json |
X-PARTNER-ID | String | Y | Client’s client_id (diberikan pada saat onboarding ) |
Params
Nama Field | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
id_provinsi | Integer | Y | Kode id dari list provinsi untuk menentukan list kota |
- PARAMS
- CURL
- PHP
- NODE JS
- GO
?id_provinsi=28
curl --location --request GET '../v1.0/list/kota?id_provinsi=28' \
--header 'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc' \
--header 'Authorization: Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7' \
--data-raw ''
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '../v1.0/list/kota?id_provinsi=28',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'Authorization: Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': '../v1.0/list/kota?id_provinsi=28',
'headers': {
'x-partner-id': '6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'Authorization': 'Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "../v1.0/list/kota?id_provinsi=28"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-partner-id", "6c57db4e-9e11-4951-9bcf-d6f177dafbcc")
req.Header.Add("Authorization", "Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Response
Parameter | Tipe Data | Deskripsi |
---|---|---|
responseCode | String | Kode response |
responseMessage | String | Pesan response |
additionalInfo | Array Of Object | Informasi tambahan. |
id_provinsi | Integer | id provinsi |
id_kota | Integer | id kota |
nama_kota | String | nama kota |
{
"responseCode": "2003100",
"responseMessage": "Successful",
"additionalInfo": [
{
"id_provinsi": 28,
"id_kota": 253,
"nama_kota": "Kabupaten Bangkalan"
},
{
"id_provinsi": 28,
"id_kota": 237,
"nama_kota": "Kabupaten Banyuwangi"
},
{
"id_provinsi": 28,
"id_kota": 232,
"nama_kota": "Kabupaten Blitar"
},
{
"id_provinsi": 28,
"id_kota": 249,
"nama_kota": "Kabupaten Bojonegoro"
},
{
"id_provinsi": 28,
"id_kota": 238,
"nama_kota": "Kabupaten Bondowoso"
},
{
"id_provinsi": 28,
"id_kota": 252,
"nama_kota": "Kabupaten Gresik"
},
{
"id_provinsi": 28,
"id_kota": 236,
"nama_kota": "Kabupaten Jember"
},
{
"id_provinsi": 28,
"id_kota": 244,
"nama_kota": "Kabupaten Jombang"
},
{
"id_provinsi": 28,
"id_kota": 233,
"nama_kota": "Kabupaten Kediri"
},
]
}
List Response Code
Response Code | Response Message | Description |
---|---|---|
2003100 | Success | |
4003101 | Invalid field format { field name } | |
4013100 | Unauthorized. Invalid Signature | X-Signature salah |
4093100 | Cannot use same X-EXTERNAL-ID in same day | X-External-ID sudah pernah digunakan di hari yang sama |
4043101 | Bad Request | Request header ada yang salah / kurang |
4043100 | Unauthorized. Client Forbidden Access API | Partner tidak dapat mengakses api terkait |
5003101 | General Error | Terjadi kesalahan |